<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>知了课堂-celery实战</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/>
    <link rel="stylesheet" href="/static/css/font.css">
    <link rel="stylesheet" href="/static/css/xadmin.css">
    <script type="text/javascript" src="/static/js/jquery-3.1.1.min.js"></script>
    <script type="text/javascript" src="/static/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="/static/js/xadmin.js"></script>
</head>

<body>
<div class="x-body">
    <form class="layui-form" action="{% url 'task_config:cron_conf_params_add' %}" method="post">
        {% csrf_token %}
        <input type="hidden" name="task_id" value="{{ task_id }}">
        <div class="layui-form-item">
            <label for="task_run_time" class="layui-form-label">
                位置参数
            </label>
            <div class="layui-input-inline">
                <input type="text" name="task_args"
                       autocomplete="off" class="layui-input" value="{{ task_args }}">
            </div>
            <div class="layui-form-mid layui-word-aux">
                <span class="x-red">*</span>列表
            </div>
        </div>

        <div class="layui-form-item">
            <label for="task_run_time" class="layui-form-label">
                关键字参数
            </label>
            <div class="layui-input-inline">
                <input type="text" name="task_kwargs"
                       autocomplete="off" class="layui-input" value="{{ task_kwargs }}">
            </div>
            <div class="layui-form-mid layui-word-aux">
                <span class="x-red">*</span>json
            </div>
        </div>
        <div class="layui-form-item">
            <label for="task_type" class="layui-form-label">
                <span class="x-red">*</span>任务队列
            </label>
            <div class="layui-input-inline">
                <select name="queue_conf_id" id="queue_conf_id">
                    {#                <option value="{{ queue_id }}">{{ queue_name }}</option>#}
                    {% for queue_conf in queue_confs %}
                        {% if queue_conf.pk == queue_id %}
                            <option value="{{ queue_conf.id }}" selected>{{ queue_conf.queue_name }}</option>
                        {% else %}
                            <option value="{{ queue_conf.id }}">{{ queue_conf.queue_name }}</option>
                        {% endif %}
                    {% endfor %}
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">
            </label>
            <button class="layui-btn" type="submit">
                修改
            </button>
        </div>
    </form>
</div>
</body>
<script>
    layui.use('laydate', function () {
        var laydate = layui.laydate;

        //执行一个laydate实例
        laydate.render({
            elem: '#task_run_time' //指定元素
        });

    });
    window.onload = function () {
        var createEl = document.getElementById('task_create_time');
        var now = new Date();
        createEl.value = now.getFullYear() + '-' + (now.getMonth() + 1) + '-' + now.getDate() + ' ' + now.getHours() + ':' + now.getMinutes() + ':' + now.getSeconds();
    }
</script>

</html>
